<?php

	class Default_Form_StartTournament extends Zend_Form
	{
		private $_action;
		
		public function __construct($action)
		{
			$this->_action = $action;
			
			parent::__construct();
		}
		
		public function init()
		{
			$this->setAction($this->_action);
			$this->setMethod('post');
			$this->setAttrib('class','form');
			
					
			$numberOfPlayers = new Zend_Form_Element_Select('numberOfPlayers');
			$numberOfPlayers->setLabel(Zend_Registry::get('translate')->_('NUMBER_OF_PLAYERS').':');
			for ($i = 2; $i <= 5; ++$i)
			{
				$numberOfPlayers->addMultiOption($i, $i);				
			}
			
			$submit = new Zend_Form_Element_Submit('submit');
			$submit->setLabel(Zend_Registry::get('translate')->_('START_TOURNAMENT'));
			
			$elements = array($numberOfPlayers, $submit);
				
			$this->addElements($elements);
			
			$this->setDisableLoadDefaultDecorators(true);
			
			$this->addDecorator('FormElements')
				 ->addDecorator('HtmlTag',array('tag' => 'ul'))
				 ->addDecorator('Form');
				 
			$this->setElementDecorators(array(
				'ViewHelper',
				'Errors',
				'Label',
				new Zend_Form_Decorator_HtmlTag(array('tag' => 'li'))
				
			));
			
			$submit->removeDecorator('Label');
		}
	}